package com.diors.game.example.server.task;

import java.util.Map;
import java.util.Map.Entry;

import com.diors.commons.thread.task.Action;
import com.diors.game.engine.arpg.scene.model.SceneModel;
import com.diors.game.engine.arpg.scene.model.SceneTypeEnum;
import com.diors.game.example.server.model.scene.SceneService;
import com.diors.game.example.server.xmldata.XmlDataManager;

/**
 * 城镇数据初始化任务
 * @author	darren.ouyang <ouyang.darren@gmail.com>
 * @date	2013-10-22
 * @version 1.0
 * @copyright Copyright (c) 2013, darren.ouyang
 */
public class CityInitTask extends Action 
{

	@Override
	protected void execute() 
	{
		Map<Integer, SceneModel> map = XmlDataManager.SCENE_DATA.getMap();
		for (Entry<Integer, SceneModel> entry : map.entrySet())
		{
			SceneModel sceneModel = entry.getValue();
			if (sceneModel.getType() != SceneTypeEnum.CITY)
				continue;
			
			SceneService.initCity(sceneModel);
		}
	}

}
